package com.ideafactory.client.ybservice;


import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

/**
 * Created by Code on 2016/2/25.
 */
public abstract class BaseFragment extends Fragment {
    public View view;
    protected SharedPreferences sp;

    /**
     * 子类数据初始化方法
     */
    protected abstract void initData();

    /**
     * 子类初始化id
     */
    protected abstract void initID();

    // 子类布局初始化
    public abstract int setContentView();



    @Override
    public View onCreateView(LayoutInflater inflater,
                             ViewGroup container, Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        view = inflater.inflate(setContentView(), container, false);
        initID();
        initData();
        return view;
    }

}
